<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:81:"/www/wwwroot/crm.liunuo.net/public/../application/user/view/customer/remind.phtml";i:1552999926;s:60:"/www/wwwroot/crm.liunuo.net/application/user/view/base.phtml";i:1552999924;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title><?php echo config('website.site_name')?></title>
    <link rel="stylesheet" href="/static/libs/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/base.css">
    <link rel="stylesheet" href="/static/css/fonts.css">
    
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header layui-bg-black">
        <div class="layui-logo"><img src="/static/user/images/logo.png" class="head-logo"></div>
        <ul class="layui-nav layui-layout-left">
            <?php if(is_array($navbar) || $navbar instanceof \think\Collection || $navbar instanceof \think\Paginator): if( count($navbar)==0 ) : echo "" ;else: foreach($navbar as $key=>$v): ?>
            <li class="layui-nav-item <?php if(isset($breadcrumb['0']) and $breadcrumb['0'] == $v['name']): ?>layui-this<?php endif; ?>">
                <a href="<?php echo \think\Request::instance()->root(true); ?>/<?php if(empty($v['url'])): ?><?php echo $v['children']['0']['url']; else: ?><?php echo $v['url']; endif; ?>"><i class="<?php echo $v['icon']; ?>"></i> <?php echo $v['name']; ?></a>
            </li>
            <?php endforeach; endif; else: echo "" ;endif; ?>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item"><a href="/" target="_blank"><i class="fa fa-home"></i> 网站首页</a></li>
            <?php $remind_sum= today_remind_sum();?>
            <li class="layui-nav-item" style="text-align: right;"><a href="/user/customer/remind/"><i class="fa fa-bell"></i> 提醒消息 <span class="layui-badge"><?php echo $remind_sum['count']; ?></span></a></li>
            <li class="layui-nav-item">
                <a href="javascript:;"><i class="fa fa-user"></i> <?php if(session('user_auth.realname')): ?><?php echo session('user_auth.realname'); else: ?><?php echo session('user_auth.username'); endif; ?></a>
                <dl class="layui-nav-child">
                    <dd><a href="<?php echo url('user/index/editPassword'); ?>">修改密码</a></dd>
                    <dd><a href="<?php echo url('user/index/logout'); ?>">退出登录</a></dd>
                </dl>
            </li>
        </ul>
    </div>
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree">
                <li class="layui-nav-item"><a href="<?php echo url('user/index/index'); ?>"><i class="fa fa-home fa-fw"></i> 系统首页</a></li>
                <?php if(is_array($navbar) || $navbar instanceof \think\Collection || $navbar instanceof \think\Paginator): if( count($navbar)==0 ) : echo "" ;else: foreach($navbar as $key=>$n0): if(isset($n0['children']) and isset($breadcrumb['0']) and $breadcrumb['0'] == $n0['name']): if(is_array($n0['children']) || $n0['children'] instanceof \think\Collection || $n0['children'] instanceof \think\Paginator): if( count($n0['children'])==0 ) : echo "" ;else: foreach($n0['children'] as $key=>$n1): ?>
                <li class="layui-nav-item <?php if(isset($breadcrumb['1']) and $breadcrumb['1'] == $n1['name']): if(isset($n1['children'])): ?>layui-nav-itemed<?php else: ?>layui-this<?php endif; endif; ?>">
                    <a href="<?php if(isset($n1['children'])): ?>javascript:;<?php else: ?><?php echo \think\Request::instance()->root(true); ?>/<?php echo $n1['url']; endif; ?>"><i class="<?php echo $n1['icon']; ?> fa-fw"></i> <?php echo $n1['name']; ?></a>
                    <?php if(isset($n1['children'])): ?>
                    <dl class="layui-nav-child">
                        <?php if(is_array($n1['children']) || $n1['children'] instanceof \think\Collection || $n1['children'] instanceof \think\Paginator): if( count($n1['children'])==0 ) : echo "" ;else: foreach($n1['children'] as $key=>$n2): ?>
                        <dd<?php if(isset($breadcrumb['2']) and $breadcrumb['2'] == $n2['name']): ?> class="layui-this"<?php endif; ?>><a href="<?php echo \think\Request::instance()->root(true); ?>/<?php echo $n2['url']; ?>"><?php echo $n2['name']; ?></a></dd>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </dl>
                    <?php endif; ?>
                </li>
                <?php endforeach; endif; else: echo "" ;endif; endif; endforeach; endif; else: echo "" ;endif; ?>
            </ul>
        </div>
    </div>
    <div class="layui-breadcrumb">
        <?php if(isset($breadcrumb)): if(is_array($breadcrumb) || $breadcrumb instanceof \think\Collection || $breadcrumb instanceof \think\Paginator): if( count($breadcrumb)==0 ) : echo "" ;else: foreach($breadcrumb as $key=>$v): ?>
        <a><cite><?php echo $v; ?></cite></a>
        <?php endforeach; endif; else: echo "" ;endif; endif; ?>
    </div>
    <div class="layui-body">
        
<div class="layui-card">
    <div class="layui-card-body">
        <div class="layui-btn-group">
            <a href="<?php echo url('user/customer/remind', ['type' => 1]); ?>" class="layui-btn <?php if(input('type') == 1 or input('type') == ''): ?>layui-btn-danger<?php endif; ?>"><i class="fa fa-bell-o"></i> 今日待处理</a>
            <a href="<?php echo url('user/customer/remind', ['type' => 2]); ?>" class="layui-btn <?php if(input('type') == 2): ?>layui-btn-danger<?php endif; ?>"><i class="fa fa-bell-o"></i> 全部待处理</a>
            <a href="<?php echo url('user/customer/remind', ['type' => 3]); ?>" class="layui-btn <?php if(input('type') == 3): ?>layui-btn-danger<?php endif; ?>"><i class="fa fa-bell-o"></i> 已处理提醒</a>
            <a href="<?php echo url('user/customer/remind', ['type' => 4]); ?>" class="layui-btn <?php if(input('type') == 4): ?>layui-btn-danger<?php endif; ?>"><i class="fa fa-bell-o"></i> 需二次处理</a>
            <a href="<?php echo url('user/customer/remind', ['type' => 5]); ?>" class="layui-btn <?php if(input('type') == 5): ?>layui-btn-danger<?php endif; ?>"><i class="fa fa-bell-o"></i> 过期未处理</a>
        </div>     
        <table class="layui-table layui-form">
            <thead>
                <tr>
                    <th>提醒时间</th>
                    <th>客户名称</th>
                    <th>手机号码</th>
                    <th>提醒方式</th>
                    <th>提醒备注</th>
                    <th>创建时间</th>
                    <?php if(input('type') != 1 && input('type') != ''): ?>
                    <th>处理时间</th>
                    <th>处理情况</th>
                    <?php endif; ?>
                    <th>操作人</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): if( count($list)==0 ) : echo "$empty" ;else: foreach($list as $key=>$v): $customer = \app\common\model\Customer::get($v['cid']); ?>
                <tr>
                    <td><?php echo date('Y-m-d',$v['remind_time'])?></td>
                    <td><a href="<?php echo url('user/customer/show', ['id' => $customer['id']]); ?>" class="layui-btn layui-btn-normal"><?php echo $customer['cname']; ?></a></td>
                    <td><?php echo $customer['mobile']; ?></td>
                    <td>
                        <?php if(isset($v['jdata']['web']) and $v['jdata']['web'] =='on'): ?><i class="fa fa-comment" aria-hidden="true" title="后台提醒"></i> <?php endif; if(isset($v['jdata']['wechat']) and $v['jdata']['wechat'] =='on'): ?><i class="fa fa-weixin" aria-hidden="true" title="微信提醒"></i> <?php endif; if(isset($v['jdata']['sms']) and $v['jdata']['sms'] =='on'): ?><i class="fa fa-envelope-open" aria-hidden="true" title="短信提醒"></i> <?php endif; ?>
                    </td>
                    <td><?php echo $v['remark']; ?></td>
                    <td><?php echo time_trans($v['create_time']); ?></td>
                    <?php if(input('type') != 1 && input('type') != ''): ?>
                    <td><?php echo time_trans($v['status_time']); ?></td>
                    <td><?php echo (isset($v['status_remark']) && ($v['status_remark'] !== '')?$v['status_remark']:'无'); ?></td>
                    <?php endif; ?>
                    <td><?php echo get_user_realname($v['uid']); ?></td>
                    <td>
                        <?php if($v['status']=='0'): ?>
                        <a href="<?php echo url('user/customer/set_remind', ['id' => $v['id']]); ?>" class="layui-btn layui-btn-normal"><i class="fa fa-edit"></i> 未处理</a>
                        <?php else: ?>
                        <a href="<?php echo url('user/customer/set_remind', ['id' => $v['id']]); ?>" class="layui-btn layui-btn-info"><i class="fa fa-edit"></i> 已处理</a>
                        <?php endif; ?>
                        <a href="<?php echo url('user/customer/del_remind', ['id' => $v['id']]); ?>" class="layui-btn layui-btn-danger ajax-delete"><i class="fa fa-trash-o"></i> 删除</a>
                    </td>
                </tr>
                <?php endforeach; endif; else: echo "$empty" ;endif; ?>
            </tbody>
        </table>
        <div class="page"><?php echo $list->render(); ?></div>
    </div>
</div>

    </div>
</div>

<script src="/static/libs/layui/layui.all.js"></script>
<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/layui.base.js"></script>
<script src="/static/js/multiSelect.js"></script>
<script src="/static/js/common.js"></script>

<?php if($remind_sum['web'] > '0'): ?>
<script type="text/javascript">
    layer.msg('今日您有 <?php echo $remind_sum['count']; ?> 条信息待处理', {
            offset:'t',
            time: 5000, //不自动关闭
            btn: ['立即处理', '稍后处理'],
            yes: function(index){
                layer.close(index);
                window.location.href='/user/customer/remind/';
            }
        }
    );
</script>
<?php endif; ?>
</body>
</html>